package com.kaifamiao.session;

import com.kaifamiao.model.Configuration;

public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        DefaultSqlSession sqlSession = new DefaultSqlSession();
        sqlSession.setConfiguration(this.configuration);
        return sqlSession;
    }
}
